<?php

namespace App\Admin\Controllers;

use App\Admin\Metrics\Examples;
use App\Admin\Metrics\Home\HomeDashboard;
use App\Admin\Metrics\Posts\AllCircle;
use App\Admin\Metrics\Posts\PostsTickets;
use App\Admin\Metrics\Posts\TotalPosts;
use App\Admin\Metrics\Users\AllUsers;
use App\Admin\Metrics\Users\NewUsers;
use App\Admin\Metrics\Users\AuthUsers;
use App\Admin\Metrics\Users\VipUsers;
use App\Http\Controllers\Controller;
use Dcat\Admin\Http\Controllers\Dashboard;

use Dcat\Admin\Layout\Column;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Layout\Row;

class HomeController extends Controller
{
    public function index(Content $content)
    {
        return $content
            ->header('统计控制台')
            ->description('')
            ->body(function (Row $row) {
                $row->column(6, function (Column $column) {
                    $column->row(HomeDashboard::title());
                    $column->row(new PostsTickets());
                });

                $row->column(6, function (Column $column) {
                    $column->row(function (Row $row) {
                        $row->column(6, new AuthUsers());
                        $row->column(6, new VipUsers());
                    });

                    $column->row(new AllUsers());
                    $column->row(new AllCircle());
                });
            });
    }
}
